class_name PlayerWalkState
extends PlayerState

const SPEED: float = 75

func enter() -> void:
	super()
	player.animation_player.play("walk", -1, 2)

func exit(new_state: State = null) -> void:
	super(new_state)
	player.velocity.x = 0

func process_physics(delta: float) -> State:
	super(delta)
	do_move(get_move_dir(), SPEED)
	if get_move_dir() == 0.0:
		return idle_state
	player.move_and_slide()
	return null

func process_input(event: InputEvent) -> State:
	super(event)
	determine_player_flipped(event)
	if event.is_action_pressed("jump"):
		return jump_state
	return null
